/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryOrderDetails;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryOrderDetailsSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryOrderDetails record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_order_details");

                if (record.getOrderId() != null) {
                    VALUES("order_id", "#{orderId,jdbcType=INTEGER}");
                }

                if (record.getPreOrdId() != null) {
                    VALUES("pre_ord_id", "#{preOrdId,jdbcType=INTEGER}");
                }

                if (record.getRecipientsId() != null) {
                    VALUES("recipients_id", "#{recipientsId,jdbcType=INTEGER}");
                }

                if (record.getPackageKilo() != null) {
                    VALUES("package_kilo", "#{packageKilo,jdbcType=DOUBLE}");
                }

                if (record.getOriginalPrice() != null) {
                    VALUES("original_price", "#{originalPrice,jdbcType=DOUBLE}");
                }

                if (record.getCourierNumber() != null) {
                    VALUES("courier_number", "#{courierNumber,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryOrderDetails record) {
        return new SQL() {
            {
                UPDATE("delivery_order_details");

                if (record.getOrderId() != null) {
                    SET("order_id = #{orderId,jdbcType=INTEGER}");
                }

                if (record.getPreOrdId() != null) {
                    SET("pre_ord_id = #{preOrdId,jdbcType=INTEGER}");
                }

                if (record.getRecipientsId() != null) {
                    SET("recipients_id = #{recipientsId,jdbcType=INTEGER}");
                }

                if (record.getPackageKilo() != null) {
                    SET("package_kilo = #{packageKilo,jdbcType=DOUBLE}");
                }

                if (record.getOriginalPrice() != null) {
                    SET("original_price = #{originalPrice,jdbcType=DOUBLE}");
                }

                if (record.getCourierNumber() != null) {
                    SET("courier_number = #{courierNumber,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}